/****************************************************************************
 * Copyright (C) 2025 Chenyz. All rights reserved.
 *
 * @file    TinyOS_Mutex.h
 *
 * @par     dependencies
 *          - stdint.h (Standard integer types)
 *          - TinyOS_Types.h (Type definitions)
 *
 * @author  Chenyz
 *
 * @brief   Mutex Management Header
 *          This file provides declarations for mutual exclusion operations
 *          in TinyOS, including:
 *          - Mutex initialization and configuration
 *          - Blocking and non-blocking mutex acquisition
 *          - Mutex release with priority inheritance
 *          - Mutex information retrieval and cleanup
 *
 * @version V1.0
 * @date    2025-10-03
 *
 * @note    This module implements mutexes with priority inheritance
 *          to prevent priority inversion in critical section protection.
 ****************************************************************************/

#ifndef __TINYOS_MUTEX_H__
#define __TINYOS_MUTEX_H__

/******************************** Includes **********************************/
#include <stdint.h>
#include "TinyOS_Types.h"

/*************************** Function Declarations **************************/

/* Mutex management functions */
void TinyOS_MutexInit(TinyOS_MutexType* Mutex);
uint32_t TinyOS_MutexTake(TinyOS_MutexType* Mutex, uint32_t WaitTicks);
uint32_t TinyOS_MutexNoWaitTake(TinyOS_MutexType* Mutex);
uint32_t TinyOS_MutexGive(TinyOS_MutexType* Mutex);
uint32_t TinyOS_MutexDelete(TinyOS_MutexType* Mutex);
void TinyOS_MutexGetInfo(TinyOS_MutexType* Mutex, TinyOS_MutexInfoType* MuetxInfo);

#endif /* __TINYOS_MUTEX_H__ */

